package com.elitesland.system.convert;

import com.elitesland.system.entity.SysUserDO;
import com.elitesland.system.entity.SysUserDTO;
import com.elitesland.system.param.SysUserNewParam;
import com.elitesland.system.vo.SysUserVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * <pre>
 * 系统用户在DO和VO之间拷贝转型
 * </pre>
 *
 * @author Mir
 * @date 2020/6/16
 */
@Mapper
public interface SysUserConvert {

    SysUserConvert INSTANCE = Mappers.getMapper(SysUserConvert.class);

    /**
     * 转换UserDO到VO，并脱敏移除密码和角色清单
     *
     * @param user UserDO对象
     * @return UserVO对象
     */
    SysUserVO doToVo(SysUserDO user);

    SysUserDO newToDo(SysUserNewParam param);

    SysUserDTO doToDto(SysUserDO user);
}
